'''列表拷贝'''
import copy

name1 = ["张三","李四","王五","赵六","陈七"]
name2 = name1.copy()#copy将原列表的字面量复制了一遍给name2
name1[2] = "郭德纲"
print(name1)
print(name2)
print("~~~~~~~~~~~")

name1 = [["张三","李四","王五"],"赵六","陈七"]
name2 = name1.copy()#当列表的某一个元素是一个列表是，复制的就是元素的地址
name1[0][0] = "郭德纲"
name1[1] = "于谦"
print(name1)
print(name2)

print("~~~~~~~~~~~")
name1 = [["张三","李四","王五"],"赵六","陈七"]
name2 = copy.copy(name1)
name1[0][0] = "郭德纲"
name1[1] = "于谦"
print(name1)
print(name2)


